header {
    background-color: #DC8CC1;
    display: flex;
    flex-direction: row;
    /* Apila el logo y el nav */
    position: sticky;
    /* Hace que todo el bloque sea sticky */
    top: 0;
    /* Pega el bloque al top al hacer scroll */
    z-index: 1000;
    /* Asegura que esté encima de otros elementos */
    justify-content: center;
    align-items: center;
    height: 220px;
}

.logo {
    margin-top: -15px;
    margin-left: 40px;
}

.navi {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    /* Asegura que ocupe todo el ancho del header */
    margin: 0;
    /* Elimina cualquier margen innecesario */
    margin-top: -25px;
}

ul {
    display: flex;
    list-style: none;
    width: 700px;
    justify-content: space-between;
    margin: 0;
    /* Elimina márgenes entre la lista */
    padding: 0;
    /* Elimina padding de la lista */
    margin-left: -70px;
    margin-top: 150px;
}

a {
    color: rgb(255, 255, 255);
    text-decoration: none;
    font-size: 25px;
    font-weight: 600;
}


.botonesdelnav {
    margin-left: -60px;
}

.botonesdelnav2 {
    margin-left: 40px;
}

.botonesdelnav3 {
    margin-left: 40px;
}

.botonesdelnav4 {
    margin-left: 40px;
}

.botonesdelnav5 {
    margin-left: 40px;
}


/*li {
    color: beige;
    font-size: large;
}*/

.boton {
    color: #fcdccf;
    display: flex;
    justify-content: center;
    margin-top: 25px;
    margin-bottom: 5px;
}

.hover:hover {
    background-color: #cf69ad;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
}

.letra {
    font-size: large;
}

/* Asegura que las secciones con id tengan un margen de desplazamiento desde el top */
section[id] {
    scroll-margin-top: 220px;
    /* Ajusta este valor según la altura de tu header */
}

/* Para asegurar que el desplazamiento tenga en cuenta el margen superior */
body {
    scroll-padding-top: 220px;
    /* Aplica este padding en el contenedor principal */
}

.ms {
    display: flex;
    margin-top: 39px;

}

.am {
    margin-top: 53px;
}

.card {
    margin-bottom: 10px;

}

.presentacion {
    /*background-image: url(../img/baner5.0.jpg);*/
    background-position: top;
    width: 100%;
    height: 400px;


}

.textopresentacion {
    color: #755C4B;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 80%;
    margin: auto;
    padding-bottom: 15px;

}

.productos {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.mila {

    width: 450px;
    margin-left: 250px;
}

.laca {
    width: 250px;

    margin-left: 80px;
}

.distancia {
    margin-top: 80px;
}

.cursos {
    display: flex;
    justify-content: center;
    align-items: stretch;

}

p {
    color: #A591A2;
    font-size: 20px;
    padding: 30px 10px 30px 10 px
}

footer {
    color: beige;
    background-color: #DC8CC1;
    font-family: 'Didact Gothic', sans-serif;
    font-size: x-large;
    text-align: center;

}


h2 {

    font-family: 'Didact Gothic', sans-serif;
    font-size: x-large;
    display: flex;
    justify-content: center;
    margin-top: 60px;
    color: #91908f
}

.final {

    justify-content: center;
    margin-top: 25px;
    margin-bottom: 25px;
    color: white;
    font-size: 30px;
    font-weight: 600;
}

h3 {
    font-family: 'Didact Gothic', sans-serif;
    font-size: large;
}

h4 {
    font-family: 'Didact Gothic', sans-serif;
    font-size: large;
}

h5 {
    font-family: sans-serif;
    font-size: small;
}

h6 {
    font-family: 'Didact Gothic', sans-serif;
    font-size: small;
}

.titulo {
    display: flex;
    justify-content: center;
}

.chat {
    position: fixed;
    right: 10px;
    bottom: 20px;
    background-color: #8cd88d;
    padding: 5px;
    border-radius: 70%;
}

.contacto {
    margin: 0;
}
/* Contenedor de los logos */
.logos-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px; /* Espacio entre los logos */
    max-width: 90%;
    margin: 0 auto; /* Centrar en la página */
}

/* Ajustes generales para los logos */
.logos {
    width: auto; /* Evita que se estire */
    height: auto;
    max-width: 220px; /* Tamaño estándar */
    max-height: 120px; /* Evita que MILA sea demasiado grande */
    display: block;
    object-fit: contain; /* Evita distorsiones */
}

@media screen and (max-width: 480px) {
    header {
        background-color: #DC8CC1;
        display: flex;
        flex-direction: column;
        /* Organiza los elementos en columna */
        align-items: center;
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 130%;
        height: auto;
        padding: 10px 0;
    }

    .logo {
        width: 300px;
        /* Ajusta el tamaño del logo */
        margin-top: -30px;
        margin-left: -320px;
        /* Centra el logo */

    }

    nav {
        width: 100%;
    }

    .navi ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Centra los botones */
        padding: 0;
        list-style: none;
        width: 100%;
        margin-top: -150px;
        margin-right: -180px;
    }

    .navi ul li {
        margin: -8px 0;
    }

    .navi ul li a {
        color: white;
        text-decoration: none;
        font-size: 15px;
        font-weight: 580;
        display: block;
        padding: 10px;
    }

    .d-block {
        height: 300px;
    }

    .logos-container {
        flex-direction: column;
        align-items: center;
    }

    .logos {
        width: 80%; /* Hacer los logos más pequeños */
        width: 300px;
        height: 550px; /* Ajustar altura */
        margin-left: 15px;

    }
    .row {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 columnas iguales */
        gap: -20px; /* Espacio pequeño entre tarjetas */
        justify-content: center;
        padding: 5px;
        max-width: 400px; /* Ajustar ancho máximo */
    }
    
    .card-container {
        width: 100%;
        max-width: 180px; /* Un poco más anchas */
        height: auto;
        max-height: 220px; /* Altura más controlada */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
        background: white;
        border-radius: 10px;
        box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        padding: 3px;
        overflow: hidden;
        margin: 3px; /* Reduce el espacio entre tarjetas */
    }
    
    .card-image {
        width: 80%;
        height: 100px; /* Más grande para que se vea bien el texto */
        object-fit: cover;
        border-radius: 5px;
        position: relative;
        margin-right: -12px;
    }
    
    .description {
        position: absolute;
        bottom: 0;
        width: 70%;
        height: 30px; /* Sombra del tamaño de la imagen */
        background: rgba(0, 0, 0, 0.5);
        color: white;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px; /* Texto más grande */
        border-radius: 5px;
    }
    
    .description h2 {
        font-size: 14px; /* Aumentamos el tamaño del título */
        margin: 4px;
        margin-top: -15px;
        
    }
    
    .description p {
        font-size: 11px; /* Aumentamos el texto */
        margin: 4px 10px;
        text-align: center;
        line-height: 1.2;
        max-height: 90px;
        overflow: hidden;
    }
    
    .description a {
        display: inline-block; /* Solo ocupa el tamaño del texto */
        max-width: 80%; /* No ocupa todo el ancho */
    }
    
    .boton {
        background-color: #DC8CC1;
        display: block;
        color: white;
        padding: 7px 10px;
        font-size: 10px;
        border-radius: 7px;
        text-decoration: none;
        display: inline-block;
        margin-bottom: -18px;
        
        
    }
    
    .boton:hover {
        background-color: #DC8CC1;
        
    }

    .chat{
        margin-right: 200px;
        margin-bottom: 100px;
    }
    
}
 /* Para pantallas medianas (481px a 768px) -> 3 columnas */
@media screen and (min-width: 481px) and (max-width: 768px){
    header {
        background-color: #DC8CC1;
        display: flex;
        flex-direction: column;
        /* Organiza los elementos en columna */
        align-items: center;
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        height: auto;
        padding: 10px 0;
    }

    .logo {
        width: 300px;
        /* Ajusta el tamaño del logo */
        margin-top: -40px;
        justify-content: center;

    }

    nav {
        width: 100%;
    }

    .navi ul {
        margin: 0 auto; /* Centra el menú en la pantalla */
        padding: 0;
    }

    .navi ul li {
        margin: -8px 0;
    }

    .navi ul li a {
        color: white;
        text-decoration: none;
        font-size: 15px;
        font-weight: 580;
        display: block;
        padding: 10px;
    }

    .d-block {
        height: 300px;
    }

    .logos-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        justify-content: center;
    }

    .logos {
        width: 90%;
        max-width: 200px;
        height: 100px; /* Controla la altura para que no tape el título */
        margin-top: 15px;
        margin-left: 35px;
    }
    .row {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 columnas iguales */
        gap: 5px; /* Espacio pequeño entre tarjetas */
        justify-content: center;
        padding: 5px;
        max-width: 400px;
    }
    
    .card-container {
        width: 100%;
        max-width: 180px; /* Un poco más anchas */
        height: auto;
        max-height: 320px; /* Altura más controlada */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
        background: white;
        border-radius: 10px;
        box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        padding: 3px;
        overflow: hidden;
        margin: 2px; /* Reduce el espacio entre tarjetas */
    }
    
    .card-image {
        width: 80%;
        height: 100px; /* Más grande para que se vea bien el texto */
        object-fit: cover;
        border-radius: 5px;
        position: relative;
    }
    
    .description {
        position: absolute;
        bottom: 0;
        width: 70%;
        height: 30px; /* Sombra del tamaño de la imagen */
        background: rgba(0, 0, 0, 0.5);
        color: white;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px; /* Texto más grande */
        border-radius: 5px;
    }
    
    .description h2 {
        font-size: 14px; /* Aumentamos el tamaño del título */
        margin: 6px 0;
    }
    
    .description p {
        font-size: 12px; /* Aumentamos el texto */
        margin: 4px 10px;
        text-align: center;
        line-height: 1.2;
        max-height: 115px;
        overflow: hidden;
    }
    .description a {
        display: inline-block;
        max-width: 90%; /* Se mantiene dentro de su espacio */
    }
    
    
    .boton {    
         display: inline-block;
         width: auto; 
        background-color: #DC8CC1;
        color: white;
        padding: 7px 10px;
        font-size: 10px;
        border-radius: 7px;
        text-decoration: none;
        margin: 2px;
    }
    
    .boton:hover {
        background-color: #DC8CC1;
        display: inline-block; 
    }
    .chat{
        margin-right: 20px;
        margin-bottom: 100px;
    }
}

@media screen and (min-width: 769px) {
    
    .logos-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Ahora son 2 columnas */
        gap: 30px; /* Espacio entre logos */
        justify-content: center;
        align-items: center;
        width: 80%; /* Reduce el ancho total */
        max-width: 900px; /* Ajusta el tamaño máximo */
        margin: auto; /* Centrar en la pantalla */
    }

    .logos-container img {
        width: 100%; /* Ajusta al tamaño del contenedor */
        height: auto; /* Mantiene la proporción */
        max-width: 400px; /* Permite que los logos sean más grandes */
        max-height: 200px; /* Controla la altura */
        object-fit: contain; /* Evita que se recorten */
        display: block;
        margin: auto; /* Centra dentro de cada celda */
    }
    
}
